SpatialStream® Code Examples

Simple Spatial Query (Polygon to Point Layer)

A simple Spatial Query can be a valuable tool when an application needs to pull data from one dataset based on its spatial relationship to a geometry. This example uses the QueryEngine from the Gas Station layer to perform a simple Spatial Query using a user generated polygon as the spatial constraint. The query is executed against the Gas Station layer and only returns the results that are within the user generated polygon.

While our general recommended approach for this workflow is to use Spatial Chaining, there are times when constructing a simple Spatial Query is useful. For instance, a simple spatial query can be used to return, on-the-fly, related data from intersecting geometries, or return related data when the setup of a Spatial Relationship rule does not make sense.

var url = "GetByGeometry.aspx";
url += "?datasource=ACCOUNT_FOLDER/IrvineGasStations";
url += "&geo=" + wkt;


Run Sample   View Video   Back To Index